<template>
	<view class="box" @click="handleToLink(link)">
		<image src="/static/index/add.png" style="width: 100%;height: 100%;" mode=""></image>
	</view>
</template>

<script>
	export default {
		props: {
			link: {
				type: String,
				default: ''
			}
		},
		methods: {
			handleToLink(url) {
				if (!uni.getStorageSync('userinfo')) {
					uni.showToast({
						title: '请先登录',
						icon: "none"
					})
					setTimeout(() => {
						uni.switchTab({
							url: '/pages/me/me'
						})
					}, 600)
				} else
					uni.navigateTo({
						url
					})
			},
		},
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 100rpx;
		height: 100rpx;
	}
</style>